package com.service.atmc;

import java.io.File;
import java.io.FileOutputStream;
import java.io.OutputStream;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Vector;

import net.sf.json.JSONArray;
import sun.misc.BASE64Decoder;

import com.bpms.common.CommonUtil;
import com.bpms.common.Db;
import com.bpms.common.HttpUtil;
import com.bpms.common.JdbcWorker;
import com.bpms.common.Param;
import com.bpms.common.VO;
import com.bpms.common.VOList;
import com.bpms.esb.IService;
import com.bpms.esb.SV;
import com.zk.atm.utils.ConstantsAtmp;

public class Showaccount implements IService {

	private static final long serialVersionUID = 1L;
	
	@Override
	public VO exec(VO arg) {
		String type=arg.getAttr("type");
		List<String> list = new ArrayList<String>();
		Map<String, String> titlemap = new HashMap<String, String>();
		List<String> list1 = new ArrayList<String>();
		VO vo = new VO();
		JdbcWorker j = null;
		VO get_account_vo=new VO();
		if ("1".equals(type)) {//根据客户签约卡查询帐号并显示
			vo.setAttr("CARDID", arg.getAttr("cardId"));
			vo.setAttr("ACCOUNTTYPE", "1");
			vo.setAttr("PASSWORD", "");
			VO result = SV.g("khqy.Getavailableaccounts", vo);
			VOList volList = (VOList) result.getObj("volist");
//			Vector<VO> vector = volList.listData;
//			for (VO gvo0 : vector) {
//				list.add(gvo0.getAttr("ACCOUNT"));
//				list1.add(gvo0.getAttr("FULLNAME"));
//			}
			get_account_vo.setObj(ConstantsAtmp.ATMP_GATEWAYSERVLET_CONVERT_BPMVO_TO_JSON_VOLIST, volList);
			get_account_vo.setAttr(ConstantsAtmp.ATMP_GATEWAYSERVLET_CONVERT_BPMVO_TO_JSON_MESSAGE, "success");
			get_account_vo.setAttr(ConstantsAtmp.ATMP_GATEWAYSERVLET_CONVERT_BPMVO_TO_JSON_RET, "0");
//			out.print(list.toString()+"@"+list1.toString());
//			out.close();
		}else if ("readidcard".equals(type)) {//根据客户签约卡查询帐号并显示
			String sql = "select ACCOUNT,USRNAME from ACCOUNTNUM WHERE CARDID='" + arg.getAttr("cardId") + "'";
			VOList volist = null;
			try {
				j = new JdbcWorker();
				j.startTransaction();
				volist = j.readAll(new VO(), sql);
				j.commit();
			} catch (Exception e) {
				e.printStackTrace();
				try {
					j.rollback();
				} catch (Exception e1) {
					e1.printStackTrace();
				}
			}
			get_account_vo.setObj(ConstantsAtmp.ATMP_GATEWAYSERVLET_CONVERT_BPMVO_TO_JSON_VOLIST, volist);
			get_account_vo.setAttr(ConstantsAtmp.ATMP_GATEWAYSERVLET_CONVERT_BPMVO_TO_JSON_MESSAGE, "success");
			get_account_vo.setAttr(ConstantsAtmp.ATMP_GATEWAYSERVLET_CONVERT_BPMVO_TO_JSON_RET, "0");
//			out.print(list.toString()+"@"+list1.toString());
//			out.close();
		}else if ("2".equals(type)) {//回单打印时显示账号
			vo.setAttr("CARDID", arg.getAttr("cardId"));
			vo.setAttr("ACCOUNTTYPE", "1");
			vo.setAttr("PASSWORD", "");
			VO result = SV.g("khqy.Getavailableaccounts", vo);
			VOList volList = (VOList) result.getObj("volist");
			
			get_account_vo.setObj(ConstantsAtmp.ATMP_GATEWAYSERVLET_CONVERT_BPMVO_TO_JSON_VOLIST, volList);
			get_account_vo.setAttr(ConstantsAtmp.ATMP_GATEWAYSERVLET_CONVERT_BPMVO_TO_JSON_MESSAGE, "success");
			get_account_vo.setAttr(ConstantsAtmp.ATMP_GATEWAYSERVLET_CONVERT_BPMVO_TO_JSON_RET, "0");
			
		}else if ("3".equals(type)) {// 根据身份证查询帐号并显示
			vo.setAttr("CARDID", arg.getAttr("cardId"));
			vo.setAttr("ACCOUNTTYPE", "3");
			vo.setAttr("PASSWORD", "");
			VO result = SV.g("khqy.Getavailableaccounts", vo);
			VOList volList = (VOList) result.getObj("volist");
			Vector<VO> vector = volList.listData;
			for (VO gvo : vector) {
				list.add(gvo.getAttr("ACCOUNT"));
			}
//			out.print(list.toString());
//			out.close();
		} else if ("saveCheck".equals(type)) {// 将扫描的图片保存到服务器
			BASE64Decoder decoder = new sun.misc.BASE64Decoder();
			String image1 = arg.getAttr("image1");//支票正面
			String image2 = arg.getAttr("image2");//支票背面
			
			String image3 = arg.getAttr("image3");//进账单正面
			String image4 = arg.getAttr("image4");//进账单背面
			
			

			Date date = new Date();
			SimpleDateFormat sdf = new SimpleDateFormat();
			//支票
			String path = "";
			String path2 = "";
			String path3 = "";
			String path4 = "";
			Long gettime = date.getTime();
			String fileName = gettime + "-1001-0";// 支票正面图片
			String fileName2 = gettime + "-1001-1";// 支票背面图片
			byte[] bt1 = new byte[20000];
			byte[] bt2 = new byte[20000];
			
			//进账单
			String fileName3 = gettime + "-1002-0";// 进账单正面图片
			String fileName4 =gettime + "-1002-1";// 进账单背面图片
			byte[] bt3 = new byte[20000];
			byte[] bt4 = new byte[20000];
			try {
				if (fileName != null) {
					bt1 = decoder.decodeBuffer(image1);
					bt2 = decoder.decodeBuffer(image2);

					for (int i = 0; i < bt1.length; i++) {
						if (bt1[i] < 0) { // 调整异常数据
							bt1[i] += 256;
						}
					}

					for (int i = 0; i < bt2.length; i++) {
						if (bt2[i] < 0) { // 调整异常数据
							bt2[i] += 256;
						}
					}

				}
				
				if (fileName3 != null) {
					bt3 = decoder.decodeBuffer(image3);
					bt4 = decoder.decodeBuffer(image4);

					for (int i = 0; i < bt3.length; i++) {
						if (bt3[i] < 0) { // 调整异常数据
							bt3[i] += 256;
						}
					}

					for (int i = 0; i < bt4.length; i++) {
						if (bt4[i] < 0) { // 调整异常数据
							bt4[i] += 256;
						}
					}

				}

				sdf.applyPattern("yyyyMMdd");
				String dirname = sdf.format(date);
				File dir = new File(Param.getValue("UAI", "bill_photo_save_path") + dirname);
				if (!dir.exists()) {
					dir.mkdirs();
				}// 中文图片显示
				if (!image1.equals("") && image1 != null) {
					path = dir + "/"
							+ fileName.replaceAll("%", "-");
				}
				if (!image2.equals("") && image2 != null) {
					path2 = dir + "/"
							+ fileName2.replaceAll("%", "-");
				}
				
				if (!image3.equals("") && image3 != null) {
					path3 = dir + "/"
					+ fileName3.replaceAll("%", "-");
				}
				if (!image4.equals("") && image4 != null) {
					path4 = dir + "/"
					+ fileName4.replaceAll("%", "-");
				}

				OutputStream fos = new FileOutputStream(
						new File(path + ".jpg"), false);
				OutputStream fos2 = new FileOutputStream(new File(path2
						+ ".jpg"), false);
				
				OutputStream fos3 = new FileOutputStream(
						new File(path3 + ".jpg"), false);
				OutputStream fos4 = new FileOutputStream(new File(path4
						+ ".jpg"), false);
				fos.write(bt1);
				fos.flush();
				fos.close();
				fos2.write(bt2);
				fos2.flush();
				fos2.close();
				fos3.write(bt3);
				fos3.flush();
				fos3.close();
				fos4.write(bt4);
				fos4.flush();
				fos4.close();

			// 保存数据
				j = new JdbcWorker();
				j.startTransaction();
				Long instanceid = j.getSeqValue("cmdjb_bizid");
				String bizid = new SimpleDateFormat("yyMMddHHmmss")
						.format(date)
						+ String.format("%08d", instanceid);
				vo.voType = "CM_DJB";

				vo.setAttr("INSTANCEID", Long.toString(instanceid));// ID号
				vo.setAttr("BIZID", bizid); // 流水号
				vo.setAttr("CARDID", arg.getAttr("currentaccount"));// 当前账号
				vo.setAttr("DEVICENO", arg.getAttr("deviceno"));// 设备号
				vo.setAttr("NETNUM", arg.getAttr("netnum"));// 网络号
				vo.setAttr("XNGYH", arg.getAttr("dianZiGuiYuan"));// 虚拟柜员号
				vo.setAttr("TRANTYPE", arg.getAttr("trans_type"));// 票据类型
				vo.setAttr("RESULTS", arg.getAttr("result"));// 操作结果
																// “0”表示异常交易
																// “1”表示正常交易
				sdf.applyPattern("yyyy-MM-dd");
				String ymd = sdf.format(date);
				sdf.applyPattern("HH:mm:ss");
				String hms = sdf.format(date);
				vo.setAttr("CREATEDATE", ymd);// 日期
				vo.setAttr("CREATETIME", hms);// 时间

				vo.setAttr("IMAGE1", path + ".jpg");
				vo.setAttr("IMAGE2", path2 + ".jpg");
				
				
				String haspsw = arg.getAttr("haspsw");
				String peopletype = arg.getAttr("peopletype");
				String phonenum = arg.getAttr("phonenum");
				String idcnum = arg.getAttr("idcnum");
				String idcname = arg.getAttr("idcname");
				String payeebk = arg.getAttr("payeebk");
				String payerbk = arg.getAttr("payerbk");
				String isewmpass = arg.getAttr("isewmpass");
				String flag = arg.getAttr("flag");
				String draweeaccno = arg.getAttr("draweeaccno");
				String pingzhenghao = arg.getAttr("pingzhenghao");
				String exchangebankno = arg.getAttr("exchangebankno");
				vo.setAttr("ISPASSWORD", haspsw);
				vo.setAttr("BEARERTYPE", peopletype);
				vo.setAttr("PHONENUMBER", phonenum);
				vo.setAttr("IDCARD", idcnum);
				vo.setAttr("IDNAME", idcname);
				vo.setAttr("PAYEEBANK", payeebk);
				vo.setAttr("DRAWEEBANK", payerbk);
				vo.setAttr("DRAWEEACCNO", draweeaccno);
				vo.setAttr("BILLNO", pingzhenghao);
				vo.setAttr("EXCHANGEBANKNO", exchangebankno);
				vo.setAttr("CHECKMARKRESULT", isewmpass);
				vo.setAttr("FLAG", flag);
				vo.setAttr("LAUNCHSITE", arg.getAttr("launchsite"));
				vo.setAttr("PAYINGMARK", arg.getAttr("payingmark"));
				vo.setAttr("QUICKMARK", arg.getAttr("quickmark"));
				vo.setAttr("DIWENCHECK", arg.getAttr("diwencheck"));
				vo.setAttr("JZDMOUNT", arg.getAttr("jzdmount"));
				vo.setAttr("CHECKMOUNT", arg.getAttr("checkmount"));
				vo.setAttr("SYSTEMTYPE", arg.getAttr("systemtype"));
				
				j.insert(vo);
				j.commit();
				
				get_account_vo.setAttr(ConstantsAtmp.ATMP_GATEWAYSERVLET_CONVERT_BPMVO_TO_JSON_MESSAGE, "success");
				get_account_vo.setAttr(ConstantsAtmp.ATMP_GATEWAYSERVLET_CONVERT_BPMVO_TO_JSON_RET, "0");
				get_account_vo.setAttr("instanceid", instanceid + "");
				
				// out.print(instanceid);
				// out.close();
			} catch (Exception e) {
				CommonUtil.debug("insertdata exception", e);
				vo.setAttr("result", "9999");
				vo.setAttr("msg", "插入错误");
				try {
					j.rollback();
				} catch (Exception e1) {
					e1.printStackTrace();
				}
			}

		} else if ("login".equals(type)) {// 查询清机人帐号和密码是否正确
			String username = arg.getAttr("username");
			String pwd = arg.getAttr("pwd");

			List<String> info = new ArrayList<String>();
			if (username.equals("") || username == null || "".equals(pwd)
					|| pwd == null) {
				get_account_vo.setAttr(ConstantsAtmp.ATMP_GATEWAYSERVLET_CONVERT_BPMVO_TO_JSON_MESSAGE, "参数为空");
				get_account_vo.setAttr(ConstantsAtmp.ATMP_GATEWAYSERVLET_CONVERT_BPMVO_TO_JSON_RET, "1");
				return get_account_vo;
			}
			try {
				Db db = new Db();
				StringBuffer userSql = new StringBuffer();
				userSql.append("select * from CLEANERINFO where USERNAME='");
				userSql.append(username);
				userSql.append("'");
				VO uservo = db.readInCombination(new VO(), userSql.toString());
				if (uservo == null) {
					get_account_vo.setAttr(ConstantsAtmp.ATMP_GATEWAYSERVLET_CONVERT_BPMVO_TO_JSON_MESSAGE, "没有该用户，请从新输入");
					get_account_vo.setAttr(ConstantsAtmp.ATMP_GATEWAYSERVLET_CONVERT_BPMVO_TO_JSON_RET, "1");
					return get_account_vo;
				}

				if (!pwd.equals(uservo.getAttr("PWD"))) {
					get_account_vo.setAttr(ConstantsAtmp.ATMP_GATEWAYSERVLET_CONVERT_BPMVO_TO_JSON_MESSAGE, "用户密码错误");
					get_account_vo.setAttr(ConstantsAtmp.ATMP_GATEWAYSERVLET_CONVERT_BPMVO_TO_JSON_RET, "1");
				} else {
					get_account_vo.setAttr(ConstantsAtmp.ATMP_GATEWAYSERVLET_CONVERT_BPMVO_TO_JSON_MESSAGE, "用户密码正确");
					get_account_vo.setAttr(ConstantsAtmp.ATMP_GATEWAYSERVLET_CONVERT_BPMVO_TO_JSON_RET, "0");
				}

			} catch (Exception e) {
				CommonUtil.debug("cleaner.login exception", e);
				get_account_vo.setAttr(ConstantsAtmp.ATMP_GATEWAYSERVLET_CONVERT_BPMVO_TO_JSON_MESSAGE, "系统异常");
				get_account_vo.setAttr(ConstantsAtmp.ATMP_GATEWAYSERVLET_CONVERT_BPMVO_TO_JSON_RET, "1");
			}
		} else if ("cleanInfo".equals(type)) {
			try {
				j = new JdbcWorker();
				j.startTransaction();
				String deviceNo = arg.getAttr("deviceno");
				
				try {
					String sql = "select HZDYS,HDDYS,CARDID,CREATEDATE,CREATETIME,DRAWEENAME,TRANTYPE,RESULTS,CHECKMOUNT,JZDMOUNT,SYSTEMTYPE,PAYEEACCNO from CM_DJB  WHERE isCleanMachine='0' and cardid is not null and deviceno='"+deviceNo+"'";
					VOList volist = j.readAll(new VO(), sql);

					Vector<VO> vector = volist.listData;
					int hddaysum = 0;//统计回单打印数
					int hzdyssum = 0;//统计回执打印数
					int i = 0;
					ArrayList<String> arr = new ArrayList<String>();

					int checknum = 0;//记录支票总数
					int n = 0;//记录贷记凭证总数
					int jzdnum = 0;//记录进账单总数
					int js = 0;//结算任务申请书总数
					int tc = 0;//同城支付凭证
					int dhpznum = 0;//电汇凭证
					int b01 = 0;
					int b02 = 0;
					int b03 = 0;
					int b04 = 0;
					int b05 = 0;
					
					for (VO vo2 : vector) {
						hddaysum += Integer.parseInt(vo2.getAttr("HDDYS"));//统计回单打印数
						hzdyssum += Integer.parseInt(vo2.getAttr("HZDYS"));//统计回执打印数
						String cardId = vo2.getAttr("CARDID");
						String createDate = vo2.getAttr("CREATEDATE");// 创建日期
						String createTime = vo2.getAttr("CREATETIME");// 创建时间
//						String draweename = vo2.getAttr("DRAWEENAME");// 收款人全称
						String tranType = vo2.getAttr("TRANTYPE");// 票据类型
						checknum = checknum + Integer.parseInt(vo2.getAttr("CHECKMOUNT"));//支票数
						jzdnum = jzdnum + Integer.parseInt(vo2.getAttr("JZDMOUNT"));//进账单数
						String systemtype = vo2.getAttr("SYSTEMTYPE");
						if ("B01".equals(systemtype)) {
							b01++;
						}  else if("B02".equals(systemtype)){
							b02++;
						}  else if("B03".equals(systemtype)) {
							b03++;
						} else if("B04".equals(systemtype)) {
							b04++;
						} else if("B05".equals(systemtype)) {
							b05++;
						} 

						String result = vo2.getAttr("RESULTS");// 操作结果
						if("1".equals(result)){
							result = "正常交易";
						}else if("0".equals(result)){
							result = "未完成交易";
						}
//						String time = createDate + " " + createTime;
						i++;
//						arr.add("{\"dataField1\":\"" + i
//								+ "\",\"dataField2\":\"" + cardId
//								+ "\",\"dataField3\":\"" + "用户名"
//								+ "\",\"dataField4\":\"" + tranType
//								+ "\",\"dataField5\":\"" + result
//								+ "\",\"dataField7\":\"" + time + "\"}");
					}
					
					SimpleDateFormat format1 = new SimpleDateFormat(
							"yyyyMMddhhmmss");
					Date date = new Date();
					String zzpch=format1.format(date)
							+ (int)Math.floor((Math.random() * 1000));

					// 更新数据库isCleanMachine=1
					String updateStr = "update CM_DJB set isCleanMachine="+zzpch+" where isCleanMachine='0' and cardid is not null and deviceno='"+deviceNo+"'";
					j.execute(updateStr);

					String dd = date.toLocaleString();
					System.out.println(dd);
					int pagepage=i/24;
					if(i%24!=0){
						pagepage++;
					}
					titlemap.put("date",dd);// 合计日期
					titlemap.put("time",dd.substring(10, 18));// 时间
					titlemap.put("acceptnotenum",i + "");// 受理票据数
					titlemap.put("hzdyssum",i + "");// 回执打印数
					titlemap.put("hddaysum",hddaysum + "");// 回单打印数
					titlemap.put("historyinfo","12");// 历史明细打印数
					titlemap.put("dianziguiyuan",arg.getAttr("dianZiGuiYuan"));// 虚拟柜员号
					titlemap.put("page",pagepage+"");// 收票清单页数
					titlemap.put("zzpch",zzpch);// 扎帐批次号
//					titlemap.put("netnum",arg.getAttr("netNum"));// 网络号
					titlemap.put("checknum",checknum+"");//支票总数
					titlemap.put("jzdnum",jzdnum+"");//进账单总数
					titlemap.put("djpz12",n+"");//贷记凭证总数（1,2联）
					titlemap.put("djpz34",n+"");//贷记凭证总数（3,4联）
					
					titlemap.put("dhpznum",dhpznum+"");//电汇凭证总数
					titlemap.put("tczfnum",tc+"");//同城支付凭证总数
					titlemap.put("jsywsqsnum",js+"");//结算任务申请书总数
					titlemap.put("hddaycount",checknum+jzdnum+n+dhpznum+"");//合计总数
					titlemap.put("b01",b01+"");
					titlemap.put("b02",b02+"");
					titlemap.put("b03",b03+"");
					titlemap.put("b04",b04+"");
					titlemap.put("b05",b05+"");

					// 保存数据
					vo.voType = "CLEANLIST";// 插入表
					vo.setAttr("OPERDATE", dd.substring(0, 10));// 合计日期
					vo.setAttr("OPERTIME", dd.substring(11, 18)); // 时间
					vo.setAttr("SLPJS", i + "");// 受理票据数
					vo.setAttr("PJHZDYS", hzdyssum + "");// 回执打印数
					vo.setAttr("HDDYS", hddaysum + "");// 回单打印数
					vo.setAttr("LSMXDYS", "12");// 历史明细打印数
					vo.setAttr("XNGYH", "虚拟柜员号");// 虚拟柜员号
					vo.setAttr("SPQDYS", "收票清单页数"); // 收票清单页数
					vo.setAttr("ZZPCH",zzpch);// 扎帐批次号
					
					vo.setAttr("NETNUM", "1234");// 网络号
					vo.setAttr("CLEANNAME", "1234");// 清机人
					j.insert(vo);
					j.commit();
//					out.print(list.toString());
//					out.print("{");
//					out.print(arr.toString());	
//					out.close();
					JSONArray ja = new JSONArray();
					ja.put(titlemap);
					get_account_vo.setObj(ConstantsAtmp.ATMP_GATEWAYSERVLET_CONVERT_BPMVO_TO_JSON_VOLIST, volist);
					get_account_vo.setAttr(ConstantsAtmp.ATMP_GATEWAYSERVLET_CONVERT_BPMVO_TO_JSON_MESSAGE, "success");
					get_account_vo.setAttr(ConstantsAtmp.ATMP_GATEWAYSERVLET_CONVERT_BPMVO_TO_JSON_RET, "0");
					get_account_vo.setObj("titlemap", ja);
				} catch (Exception e) {
					e.printStackTrace();	
					j.rollback();
				}

			} catch (Exception e) {
				e.printStackTrace();
			}
		} else if ("receiptprint".equals(type)) {// 回执打印
			try {
				SimpleDateFormat format = new SimpleDateFormat("yyyyMMddhhmmss");
				Date date = new Date();
				String dd = format.format(date);
				j = new JdbcWorker();
				String sql = "select * from CM_DJB  WHERE INSTANCEID='"
						+ arg.getAttr("instanceid") + "'";

				VO resultvo = j.readInCombination(new VO(), sql);
				System.out.println("sql:......."+sql);
				String tranType = resultvo.getAttr("TRANTYPE");
				if ("01".equals(tranType)) {
					tranType = "支票";
				}  else if("02".equals(tranType)){
					tranType = "转账支票";

				} else if("03".equals(tranType)) {
					tranType = "结算业务申请书";
				} else if("04".equals(tranType)) {
					tranType = "同城支付凭证";
				}
				
				System.err.println(" 张旭===========================猪" + resultvo.getAttr("CARDID"));
				
				String resultstr = resultvo.getAttr("CARDID") + "@" // 账号
						+ "用户名" + "@" // 账号
						+ tranType + "@" // 业务类型
						+ 1 + "@" // 村票数
						+ resultvo.getAttr("CREATETIME") + "@" // 存入时间
						+ resultvo.getAttr("XNGYH") + "@" // 虚拟柜员号
						+ dd + "@" // 打印时间
						+ resultvo.getAttr("BIZID") + "@"; // 回执编号
				
				get_account_vo.setAttr(ConstantsAtmp.ATMP_GATEWAYSERVLET_CONVERT_BPMVO_TO_JSON_MESSAGE, "success");
				get_account_vo.setAttr(ConstantsAtmp.ATMP_GATEWAYSERVLET_CONVERT_BPMVO_TO_JSON_RET, "0");
				get_account_vo.setAttr("result", resultstr);
//				out.print(resultstr.toString());
//				out.close();
			} catch (Exception e) {
				e.printStackTrace();
			}

		}else if("testNet".equals(type)){//测试网络
//			out.print("good");
//			out.close();
		}else if("HDDY".equals(type)){//回单补打的账号
			try {
				j=new JdbcWorker();
				String sql = "select * from cm_djb where  STATUS = '1' and RZHD = '0'";
				VOList volist = j.readAll(new VO(), sql);

				ArrayList<String> arr = new ArrayList<String>();
				Vector<VO> vector = volist.listData;
				int i=1;//序号
				for (VO vo2 : vector) {
					String araweeaccno=vo2.getAttr("DRAWEEACCNO");//收款人账号
					String payeeaccno=vo2.getAttr("PAYEEACCNO");//付款人账号
					String amount=vo2.getAttr("AMOUNT");//金额
					String dycs=vo2.getAttr("DYCS");//打印次数
					
					arr.add("{\"no\":\"" + i
							+ "\",\"araweeaccno\":\"" + araweeaccno
							+ "\",\"payeeaccno\":\"" + payeeaccno
							+ "\",\"amount\":\"" + amount
							+ "\",\"dycs\":\"" + dycs + "\"}");
					i++;
				}
//				out.print(arr.toString());	
//				out.close();
			} catch (Exception e) {
				e.printStackTrace();
			}
			
		}else if("receiptDetail".equals(type)){//账号下的交易记录
			try {
				j=new JdbcWorker();
				String isAgainPrint=arg.getAttr("isAgainPrint")+"";
				String starttime=arg.getAttr("starttime");
				String endtime=arg.getAttr("endtime");
//				starttime=starttime.replace('年','-');
//				starttime=starttime.replace('月','-');
//				starttime=starttime.replace('日','-');
//				
//				endtime=endtime.replace('年', '-');
//				endtime=endtime.replace('月', '-');
//				endtime=endtime.replace('日', '-');
				
				StringBuilder sql = new StringBuilder("select * from HDINFO where  ACCOUNT='");
				sql.append(arg.getAttr("account")).append("'");
				if("true".endsWith(isAgainPrint)){
					sql.append(" and DYCS!='0'");
				}else{
					sql.append(" and DYCS='0'");
				}
				sql.append(" and CREATEDATE between '");
				sql.append(starttime).append("' and '");
				sql.append(endtime).append("'");
				
				
				
				String pageNumber=arg.getAttr("number");
				String pageSize=arg.getAttr("size");
				
				String sqlstr = "select * from (select mypager.*,rownum num from ( " + sql.toString() + " ) mypager) ";
				sqlstr += "where num > ("+pageNumber+"-1) * "+pageSize+" and num <="+pageNumber+" * "+pageSize;
				
				String limit = arg.getAttr("limit");
				VOList volist=new VOList();
				String cc = "";
				if("part".equals(limit)){
					volist = j.readAll(new VO(), sqlstr);
					if("1".equals(pageNumber)){
						StringBuilder count = new StringBuilder("select count(*) from HDINFO where  ACCOUNT='");
						count.append(arg.getAttr("account")).append("'");
						if("true".endsWith(isAgainPrint)){
							count.append(" and DYCS!='0'");
						}else{
							count.append(" and DYCS='0'");
						}
						count.append(" and CREATEDATE between '");
						count.append(starttime).append("' and '");
						count.append(endtime).append("'");
						VO counts=j.readInCombination(new VO(),count.toString());
						cc = counts.getAttr("count(*)");
					}
					
				}else if("all".equals(limit)){
					volist = j.readAll(new VO(), sql.toString());
				}


				ArrayList<String> arr2 = new ArrayList<String>();//存放要打印的信息
				Vector<VO> vector = volist.listData;
				int i=1;//序号
				for (VO vo2 : vector) {
					String id=vo2.getAttr("ID");//id号//
					String account=vo2.getAttr("ACCOUNT");//账号
//					System.out.println("account....:"+account);
//					String payeeaccno=vo2.getAttr("PAYEEACCNO");//出票人账号
//					String payeename=vo2.getAttr("PAYEENAME");//出票人全称
//					String amount=vo2.getAttr("AMOUNT");//金额
					String dycs=vo2.getAttr("DYCS");//打印次数
//					String payeebank=vo2.getAttr("PAYEEBANK");//出票人开户银行
//					String draweename=vo2.getAttr("DRAWEENAME");//收款人全称
//					String draweeaccno=vo2.getAttr("DRAWEEACCNO");//收款人账号
//					String draweebank=vo2.getAttr("DRAWEEBANK");//收款人开户行
//					String billtype=vo2.getAttr("BILLTYPE");//票据种类
//					String bills=vo2.getAttr("BILLS");//票据张数
//					String billno=vo2.getAttr("BILLNO");//票据号码
//					
//					arr2.add("{\"payeename\":\"" + payeename
//							
//							+ "\",\"no\":\"" + i
//							+ "\",\"dycs\":\"" + dycs
//							+ "\",\"id\":\"" + id
//							
//							+ "\",\"payeeaccno\":\"" + payeeaccno
//							+ "\",\"payeebank\":\"" + payeebank
//							+ "\",\"draweename\":\"" + draweename
//							+ "\",\"draweeaccno\":\"" + draweeaccno
//							+ "\",\"draweebank\":\"" + draweebank
//							+ "\",\"amount\":\"" + amount
//							+ "\",\"billtype\":\"" + billtype
//							+ "\",\"bills\":\"" + bills
//							+ "\",\"billno\":\"" + billno + "\"}");
//					i++;
					
					int DYCS=Integer.parseInt(dycs);
					DYCS++;
					
					//更新打印次数
//					if("all".equals(limit)){
//						StringBuilder sqlStr = new StringBuilder("update HDINFO set DYCS='");
//						sqlStr.append(dycs+"' where ID='").append(id).append("'");
//						j.execute(sqlStr.toString());
//						
//						//更新CM_DJB中的打印次数
//						StringBuilder sqlToCm_djb=new StringBuilder("update CM_DJB set HDDYS='");
//						sqlToCm_djb.append(DYCS+"' where CARDID='").append(account).append("'");
//						j.execute(sqlToCm_djb.toString());
//					}
				}
				get_account_vo.setObj(ConstantsAtmp.ATMP_GATEWAYSERVLET_CONVERT_BPMVO_TO_JSON_VOLIST, volist);
				get_account_vo.setAttr(ConstantsAtmp.ATMP_GATEWAYSERVLET_CONVERT_BPMVO_TO_JSON_MESSAGE, "success");
				get_account_vo.setAttr(ConstantsAtmp.ATMP_GATEWAYSERVLET_CONVERT_BPMVO_TO_JSON_RET, "0");
				get_account_vo.setAttr("cc", cc);
			} catch (Exception e) {
				e.printStackTrace();
			}

		}else if("updateDYCS".equals(type)){
			try {
				j=new JdbcWorker();
				String update = arg.getAttr("updateArr");
				String[] updateArr = update.split(",");
				for(int i=0;i<updateArr.length;i++){
					String[] Arr = updateArr[i].split("@");
					StringBuilder sql = new StringBuilder("update HDINFO set DYCS='");
					sql.append(Arr[1]+"' where ACCOUNT='").append(Arr[0]).append("'");
					j.execute(sql.toString());
					
					//更新CM_DJB中的打印次数
					StringBuilder sqlToCm_djb=new StringBuilder("update CM_DJB set HDDYS='");
					sqlToCm_djb.append(Arr[1]+"' where CARDID='").append(Arr[0]).append("'");
					j.execute(sqlToCm_djb.toString());
				}
				j.commit();
				get_account_vo.setAttr(ConstantsAtmp.ATMP_GATEWAYSERVLET_CONVERT_BPMVO_TO_JSON_MESSAGE, "success");
				get_account_vo.setAttr(ConstantsAtmp.ATMP_GATEWAYSERVLET_CONVERT_BPMVO_TO_JSON_RET, "0");
			} catch (Exception e) {
				e.printStackTrace();
				get_account_vo.setAttr(ConstantsAtmp.ATMP_GATEWAYSERVLET_CONVERT_BPMVO_TO_JSON_MESSAGE, "更新失败");
				get_account_vo.setAttr(ConstantsAtmp.ATMP_GATEWAYSERVLET_CONVERT_BPMVO_TO_JSON_RET, "1");
			}
			
		} else if("queryCode".equals(type)) {
			try {
				j = new JdbcWorker();
				String code = arg.getAttr("code");
				Map<String,String> map = HttpUtil.checkQuickMark(code);
				if(map == null){
					get_account_vo.setAttr("result", "false"); 
				}else {
					get_account_vo.setAttr("result", "true"); 
				}
				get_account_vo.setAttr(ConstantsAtmp.ATMP_GATEWAYSERVLET_CONVERT_BPMVO_TO_JSON_MESSAGE, "success");
				get_account_vo.setAttr(ConstantsAtmp.ATMP_GATEWAYSERVLET_CONVERT_BPMVO_TO_JSON_RET, "0");
				get_account_vo.setAttr("draweeaccno", map.get("DRAWEEACCNO")); 
				get_account_vo.setAttr("pingzhenghao", map.get("PINGZHENGHAO")); 
				get_account_vo.setAttr("exchangebankno", map.get("EXCHANGEBANKNO")); 
//				StringBuilder sql = new StringBuilder("select * from dimechart where encryption='");
//				sql.append(code).append("'");
//				VO vol = j.readInCombination(new VO(), sql.toString());
//				String aa;
//				if(vol == null) {
//					aa = "nodata";
//				} else {
//					aa = "data";
//				}
				
//				out.print(aa);
//				out.close();
			} catch (Exception e) {
				
				e.printStackTrace();
			}
		}	else if("payinput".equals(type)){ //验证非ID卡用户登录。并返回该用户的信息。
			String name=arg.getAttr("payeename");
			String account=arg.getAttr("payeeaccount");
			String payeebank=arg.getAttr("payeebank");
			vo.setAttr("pname", name);
			vo.setAttr("paccount", account);
			vo.setAttr("payeebank", payeebank);
			VO result = SV.g("khqy.Selectpayee", vo);
		    	result.getAttr("");
			String payee= result.getAttr("account").toString()+","+result.getAttr("fullname").toString()+","+result.getAttr("bank").toString();
			get_account_vo.setObj(ConstantsAtmp.ATMP_GATEWAYSERVLET_CONVERT_BPMVO_TO_JSON_VOLIST, payee);
			get_account_vo.setAttr(ConstantsAtmp.ATMP_GATEWAYSERVLET_CONVERT_BPMVO_TO_JSON_MESSAGE, "success");
			get_account_vo.setAttr(ConstantsAtmp.ATMP_GATEWAYSERVLET_CONVERT_BPMVO_TO_JSON_RET, "0");
		}else if("saveCheckBS".equals(type)){// 将扫描的图片保存到服务器
			BASE64Decoder decoder = new sun.misc.BASE64Decoder();
			String image1 = arg.getAttr("image1");
			String image2 = arg.getAttr("image2");

			Date date = new Date();
			SimpleDateFormat sdf = new SimpleDateFormat();
			String path = "";
			String path2 = "";
			String fileName = "front" + date.getTime();// 正面图片
			String fileName2 = "reverse" + date.getTime();// 背面图片
			byte[] bt1 = new byte[20000];
			byte[] bt2 = new byte[20000];
			try {
				if (fileName != null) {
					bt1 = decoder.decodeBuffer(image1);
					bt2 = decoder.decodeBuffer(image2);

					for (int i = 0; i < bt1.length; i++) {
						if (bt1[i] < 0) { // 调整异常数据
							bt1[i] += 256;
						}
					}

					for (int i = 0; i < bt2.length; i++) {
						if (bt2[i] < 0) { // 调整异常数据
							bt2[i] += 256;
						}
					}

				}

				sdf.applyPattern("yyyyMMdd");
				String dirname = sdf.format(date);
				File dir = new File("C:\\bills\\" + dirname);
				if (!dir.exists()) {
					dir.mkdirs();
				}// 中文图片显示
				if (!image1.equals("") && image1 != null) {
					path = dir.getAbsolutePath() + "\\"
							+ fileName.replaceAll("%", "-");
				}
				if (!image2.equals("") && image2 != null) {
					path2 = dir.getAbsolutePath() + "\\"
							+ fileName2.replaceAll("%", "-");
				}

				OutputStream fos = new FileOutputStream(
						new File(path + ".jpg"), false);
				OutputStream fos2 = new FileOutputStream(new File(path2
						+ ".jpg"), false);
				fos.write(bt1);
				fos.flush();
				fos.close();
				fos2.write(bt2);
				fos2.flush();
				fos2.close();

			// 保存数据
				j = new JdbcWorker();
				j.startTransaction();
				Long instanceid = j.getSeqValue("cmdjb_bizid");
				String bizid = new SimpleDateFormat("yyMMddHHmmss")
						.format(date)
						+ String.format("%08d", instanceid);
				vo.voType = "CM_DJB";

				vo.setAttr("INSTANCEID", Long.toString(instanceid));// ID号
				vo.setAttr("BIZID", bizid); // 流水号
				vo.setAttr("CARDID", arg.getAttr("currentaccount"));// 当前账号
				vo.setAttr("DEVICENO", arg.getAttr("deviceno"));// 设备号
				vo.setAttr("NETNUM", arg.getAttr("netnum"));// 网络号
				vo.setAttr("XNGYH", arg.getAttr("dianZiGuiYuan"));// 虚拟柜员号
				vo.setAttr("TRANTYPE", arg.getAttr("trans_type"));// 票据类型
				vo.setAttr("RESULTS", arg.getAttr("result"));// 操作结果
																// “0”表示异常交易
																// “1”表示正常交易
				sdf.applyPattern("yyyy-MM-dd");
				String ymd = sdf.format(date);
				sdf.applyPattern("HH:mm:ss");
				String hms = sdf.format(date);
				vo.setAttr("CREATEDATE", ymd);// 日期
				vo.setAttr("CREATETIME", hms);// 时间

				vo.setAttr("IMAGE1", path + ".jpg");
				vo.setAttr("IMAGE2", path2 + ".jpg");
				
				
			//	String haspsw = arg.getAttr("haspsw");
			//	String peopletype = arg.getAttr("peopletype");
			//	String phonenum = arg.getAttr("phonenum");
			//	String idcnum = arg.getAttr("idcnum");
			//	String idcname = arg.getAttr("idcname");
			//	String payeebk = arg.getAttr("payeebk");
			//	String payerbk = arg.getAttr("payerbk");
				String isewmpass = arg.getAttr("isewmpass");
				String flag = arg.getAttr("flag");
				String draweeaccno = arg.getAttr("draweeaccno");
				String pingzhenghao = arg.getAttr("pingzhenghao");
				String exchangebankno = arg.getAttr("exchangebankno");
//				vo.setAttr("ISPASSWORD", haspsw);
//				vo.setAttr("BEARERTYPE", peopletype);
//				vo.setAttr("PHONENUMBER", phonenum);
//				vo.setAttr("IDCARD", idcnum);
//				vo.setAttr("IDNAME", idcname);
//				vo.setAttr("PAYEEBANK", payeebk);
//				vo.setAttr("DRAWEEBANK", payerbk);
				vo.setAttr("DRAWEENAME",arg.getAttr("payername") );//付款人全称
				vo.setAttr("DRAWEEACCNO",arg.getAttr("payeraccount") );//付款人账号
				vo.setAttr("DRAWEEBANK",arg.getAttr("payerbank") );//付款人开户行
				vo.setAttr("PAYEENAME",arg.getAttr("payeename") );//收款人全称
				vo.setAttr("PAYEEACCNO",arg.getAttr("payeeaccount") );//收款人账号
				vo.setAttr("PAYEEBANK",arg.getAttr("PayeeBank") );//收款人开户行
				vo.setAttr("AMOUNT",arg.getAttr("money"));// 金额
			//	vo.setAttr("DRAWEEACCNO", draweeaccno);
				vo.setAttr("BILLNO", pingzhenghao);
				vo.setAttr("EXCHANGEBANKNO", exchangebankno);
				vo.setAttr("CHECKMARKRESULT", isewmpass);
				vo.setAttr("FLAG", flag);
				
				j.insert(vo);
				j.commit();
				
				get_account_vo.setAttr(ConstantsAtmp.ATMP_GATEWAYSERVLET_CONVERT_BPMVO_TO_JSON_MESSAGE, "success");
				get_account_vo.setAttr(ConstantsAtmp.ATMP_GATEWAYSERVLET_CONVERT_BPMVO_TO_JSON_RET, "0");
				get_account_vo.setAttr("instanceid", instanceid + "");
				
				// out.print(instanceid);
				// out.close();
			} catch (Exception e) {
				CommonUtil.debug("insertdata exception", e);
				vo.setAttr("result", "9999");
				vo.setAttr("msg", "插入错误");
				try {
					j.rollback();
				} catch (Exception e1) {
					e1.printStackTrace();
				}
			}

		
			
		}else if ("receiptprintBS".equals(type)) {// 包商回执打印
			try {
				SimpleDateFormat format = new SimpleDateFormat("yyyyMMddhhmmss");
				Date date = new Date();
				String dd = format.format(date);
				j = new JdbcWorker();
				String sql = "select * from CM_DJB  WHERE INSTANCEID='"
						+ arg.getAttr("instanceid") + "'";
				VO resultvo = j.readInCombination(new VO(), sql);
				System.out.println("sql:......."+sql);
				String tranType = resultvo.getAttr("TRANTYPE");
				if ("01".equals(tranType)) {
					tranType = "支票";
				}  else if("02".equals(tranType)){
					tranType = "贷记凭证";

				} else if("03".equals(tranType)) {
					tranType = "结算业务申请书";
				} else if("04".equals(tranType)) {
					tranType = "同城支付凭证";
				}

				String resultstr = resultvo.getAttr("PAYEEACCNO") + "@" // 收款人账号
				+ resultvo.getAttr("PAYEENAME") + "@" // 收款人全称
				+ resultvo.getAttr("PAYEEBANK") + "@" //收款人开户行
				+ resultvo.getAttr("DRAWEEACCNO") + "@" // 付款人帐号
				+ resultvo.getAttr("DRAWEENAME") + "@" // 付款人全称
				+ resultvo.getAttr("DRAWEEBANK") + "@" // 付款人开户行
				+ resultvo.getAttr("AMOUNT") + "@" // 交易金额
				+ tranType + "@" // 业务类型
				+ 1 + "@" // 村票数
				+ resultvo.getAttr("CREATETIME") + "@" // 存入时间
				+ resultvo.getAttr("XNGYH") + "@" // 虚拟柜员号
				+ dd + "@" // 打印时间
				+ resultvo.getAttr("BIZID") + "@"// 回执编号
				+ resultvo.getAttr("BILLNO") + "@"; //票据单号
				
				get_account_vo.setAttr(ConstantsAtmp.ATMP_GATEWAYSERVLET_CONVERT_BPMVO_TO_JSON_MESSAGE, "success");
				get_account_vo.setAttr(ConstantsAtmp.ATMP_GATEWAYSERVLET_CONVERT_BPMVO_TO_JSON_RET, "0");
				get_account_vo.setAttr("result", resultstr);
//				out.print(resultstr.toString());
//				out.close();
			} catch (Exception e) {
				e.printStackTrace();
			}
		}else if ("cleanInfoBS".equals(type)) {
			try {
				j = new JdbcWorker();
				j.startTransaction();
				try {
					String sql = "select HZDYS,HDDYS,CARDID,CREATEDATE,CREATETIME," +
							"DRAWEENAME,TRANTYPE,RESULTS,CHECKMOUNT,JZDMOUNT," +
							"SYSTEMTYPE,PAYEEACCNO,PAYEENAME from " +
							"CM_DJB  WHERE isCleanMachine='0' ";
					VOList volist = j.readAll(new VO(), sql);

					Vector<VO> vector = volist.listData;
					int hddaysum = 0;//统计回单打印数
					int hzdyssum = 0;//统计回执打印数
					int i = 0;
					ArrayList<String> arr = new ArrayList<String>();

					int checknum = 0;//记录支票总数
					int n = 0;//记录贷记凭证总数
					int jzdnum = 0;//记录进账单总数
					int js = 0;//结算任务申请书总数
					int tc = 0;//同城支付凭证
					int dhpznum = 0;//电汇凭证
					int b01 = 0;
					int b02 = 0;
					int b03 = 0;
					int b04 = 0;
					int b05 = 0;
					
					for (VO vo2 : vector) {
						hddaysum += Integer.parseInt(vo2.getAttr("HDDYS"));//统计回单打印数
						hzdyssum += Integer.parseInt(vo2.getAttr("HZDYS"));//统计回执打印数
						String cardId = vo2.getAttr("CARDID");
						String createDate = vo2.getAttr("CREATEDATE");// 创建日期
						String createTime = vo2.getAttr("CREATETIME");// 创建时间
//						String draweename = vo2.getAttr("DRAWEENAME");// 收款人全称
						String tranType = vo2.getAttr("TRANTYPE");// 票据类型
						checknum = checknum + Integer.parseInt(vo2.getAttr("CHECKMOUNT"));//支票数
						jzdnum = jzdnum + Integer.parseInt(vo2.getAttr("JZDMOUNT"));//进账单数
						String systemtype = vo2.getAttr("SYSTEMTYPE");
						if ("B01".equals(systemtype)) {
							b01++;
						}  else if("B02".equals(systemtype)){
							b02++;
						}  else if("B03".equals(systemtype)) {
							b03++;
						} else if("B04".equals(systemtype)) {
							b04++;
						} else if("B05".equals(systemtype)) {
							b05++;
						} 

						String result = vo2.getAttr("RESULTS");// 操作结果
						if("1".equals(result)){
							result = "正常交易";
						}else if("0".equals(result)){
							result = "未完成交易";
						}
//						String time = createDate + " " + createTime;
						i++;
//						arr.add("{\"dataField1\":\"" + i
//								+ "\",\"dataField2\":\"" + cardId
//								+ "\",\"dataField3\":\"" + "用户名"
//								+ "\",\"dataField4\":\"" + tranType
//								+ "\",\"dataField5\":\"" + result
//								+ "\",\"dataField7\":\"" + time + "\"}");
					}
					
					SimpleDateFormat format1 = new SimpleDateFormat(
							"yyyyMMddhhmmss");
					Date date = new Date();
					String zzpch=format1.format(date)
							+ (int)Math.floor((Math.random() * 1000));

					// 更新数据库isCleanMachine=1
//					String updateStr = "update CM_DJB  set isCleanMachine="+zzpch+" where isCleanMachine='0' and cardid is not null";
//					j.execute(updateStr);

					String dd = date.toLocaleString();
					System.out.println(dd);
					int pagepage=i/24;
					if(i%24!=0){
						pagepage++;
					}
					titlemap.put("date",dd.substring(0, 10));// 合计日期
					titlemap.put("time",dd.substring(10, 18));// 时间
					titlemap.put("acceptnotenum",i + "");// 受理票据数
					titlemap.put("hzdyssum",i + "");// 回执打印数
					titlemap.put("hddaysum",hddaysum + "");// 回单打印数
					titlemap.put("historyinfo","12");// 历史明细打印数
					titlemap.put("dianziguiyuan",arg.getAttr("dianZiGuiYuan"));// 虚拟柜员号
					titlemap.put("page",pagepage+"");// 收票清单页数
					titlemap.put("zzpch",zzpch);// 扎帐批次号
//					titlemap.put("netnum",arg.getAttr("netNum"));// 网络号
					titlemap.put("checknum",checknum+"");//支票总数
					titlemap.put("jzdnum",jzdnum+"");//进账单总数
					titlemap.put("djpz12",n+"");//贷记凭证总数（1,2联）
					titlemap.put("djpz34",n+"");//贷记凭证总数（3,4联）
					
					titlemap.put("dhpznum",dhpznum+"");//电汇凭证总数
					titlemap.put("tczfnum",tc+"");//同城支付凭证总数
					titlemap.put("jsywsqsnum",js+"");//结算任务申请书总数
					titlemap.put("hddaycount",checknum+jzdnum+n+dhpznum+"");//合计总数
					titlemap.put("b01",b01+"");
					titlemap.put("b02",b02+"");
					titlemap.put("b03",b03+"");
					titlemap.put("b04",b04+"");
					titlemap.put("b05",b05+"");

					// 保存数据
					vo.voType = "CLEANLIST";// 插入表
					vo.setAttr("OPERDATE", dd.substring(0, 10));// 合计日期
					vo.setAttr("OPERTIME", dd.substring(11, 18)); // 时间
					vo.setAttr("SLPJS", i + "");// 受理票据数
					vo.setAttr("PJHZDYS", hzdyssum + "");// 回执打印数
					vo.setAttr("HDDYS", hddaysum + "");// 回单打印数
					vo.setAttr("LSMXDYS", "12");// 历史明细打印数
					vo.setAttr("XNGYH", "虚拟柜员号");// 虚拟柜员号
					vo.setAttr("SPQDYS", "收票清单页数"); // 收票清单页数
					vo.setAttr("ZZPCH",zzpch);// 扎帐批次号
					
					vo.setAttr("NETNUM", "1234");// 网络号
					vo.setAttr("CLEANNAME", "1234");// 清机人
					j.insert(vo);
					j.commit();
//					out.print(list.toString());
//					out.print("{");
//					out.print(arr.toString());	
//					out.close();
					JSONArray ja = new JSONArray();
					ja.put(titlemap);
					get_account_vo.setObj(ConstantsAtmp.ATMP_GATEWAYSERVLET_CONVERT_BPMVO_TO_JSON_VOLIST, volist);
					get_account_vo.setAttr(ConstantsAtmp.ATMP_GATEWAYSERVLET_CONVERT_BPMVO_TO_JSON_MESSAGE, "success");
					get_account_vo.setAttr(ConstantsAtmp.ATMP_GATEWAYSERVLET_CONVERT_BPMVO_TO_JSON_RET, "0");
					get_account_vo.setObj("titlemap", ja);
				} catch (Exception e) {
					e.printStackTrace();	
					j.rollback();
				}

			} catch (Exception e) {
				e.printStackTrace();
			}
		}
		return get_account_vo;
	}
}
